package internetConnection;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class ClientRunner {

	ServerRunnerInterface obj;
	public  void initRMI(){
			
		    try {
		      Registry registry = LocateRegistry.getRegistry();//
		      obj = (ServerRunnerInterface)
		        registry.lookup("ServerRunnerInterface");
		      System.out.println("Server object " + obj + " found");
		    }
		    catch(Exception ex) {
		      System.out.println(ex);
		    }
	}
	public void test(){
		try {
			String s=obj.databaseInit();
			System.out.println(s);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		ClientRunner cr=new ClientRunner();
		cr.initRMI();
		cr.test();
		

	}


}
